/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sv;

import business.BankBusiness;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import model.Bank;

/**
 *
 * @author khanhanh
 */
@WebService()
public class BankService {

    private BankBusiness bankBiz = new BankBusiness();

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getBankDetails")
    public Bank getBankDetails(@WebParam(name = "ccNumber") String ccNumber, @WebParam(name = "pinCode") String pinCode) {
        //TODO write your implementation code here:
        return bankBiz.getBankDetails(ccNumber, pinCode);
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "deposit")
    public boolean deposit(@WebParam(name = "ccNumber") String ccNumber, @WebParam(name = "pinCode") String pinCode, @WebParam(name = "amount") float amount) {
        return bankBiz.deposit(ccNumber, pinCode, amount);
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "withdraw")
    public boolean withdraw(@WebParam(name = "ccNumber") String ccNumber, @WebParam(name = "pinCode") String pinCode, @WebParam(name = "amount") float amount) {
        return bankBiz.withdraw(ccNumber, pinCode, amount);
    }

    /**
     * Web service operation
     */
    @WebMethod(operationName = "getBankDetailsByCusID")
    public Bank getBankDetailsByCusID(@WebParam(name = "customerID") int customerID) {
        return bankBiz.getBankDetailsByCusID(customerID);
    }
}
